Repository navigation
ci: release packages with changesets and npm trusted publishing - #127
Merged
Merged
Conversation
Add a release workflow on main. While changesets are pending, it opens or updates a "chore: release" pull request. Once that pull request is merged, it packs the packages whose version is not on npm yet and publishes them with npm trusted publishing (OIDC), then creates git tags and GitHub releases. Only the publish job gets id-token: write. Amp-Thread-ID: https://ampcode.com/threads/T-01a1cc89-88ff-735a-b0e6-546b99965804
|
A tag invalidation counts entries created in the same millisecond as invalidated. When cache3 recomputed baz in the same millisecond as the invalidation of tag x, the next read invalidated it again and returned 3333 instead of 333. Wait after the invalidation, as the neighbouring test does. Amp-Thread-ID: https://ampcode.com/threads/T-01a1cc89-88ff-735a-b0e6-546b99965804
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
.github/workflows/release.yml, which releases packages frommainwithchangesets/actionv2 and npm trusted publishing (OIDC). No npm token is needed. It follows the trusted publishing setup from the Changesets docs. Each push tomainruns these jobs:select-modedecides what to do:versionwhen changesets are pending,publishwhen a package version is missing from npm, otherwise nothing.versionopens or updates achore: releasepull request. That pull request contains the version bumps and CHANGELOG entries fromchangeset version.packbuilds the workspace and runschangeset pack. This step does not haveid-token.publishpublishes the tarballs withid-token: write, then pushes git tags and creates GitHub releases.The workflow uses pnpm from the
packageManagerfield and Node 24. The repository-levelpermissionsis{}, and only the publish job can get an OIDC token.Before merging
bentocache,@bentocache/oteland@bentocache/plugin-prometheus. Use repositoryJulien-R44/bentocache, workflowrelease.ymland no environment.What happens after merge
Three changesets for
@bentocache/otelare pending onmain. The first run opens achore: releasepull request that bumps@bentocache/otelto0.2.0. Merging that pull request publishes@bentocache/otel@0.2.0.bentocache1.6.1 and@bentocache/plugin-prometheus0.2.0 are already on npm, so they are skipped.Pull requests opened by
GITHUB_TOKENdo not trigger CI. You can run CI on the release pull request manually, or later give the version job a GitHub App token.Verification
actionlintreports no issues.changeset publish-planandchangeset packlocally with@bentocache/otelbumped to0.2.0. The plan contains only@bentocache/otel@0.2.0. In the tarball,workspace:*is replaced andbuild/is included.